
/* 配置文件,之后的中间件需要在config/index.js中进行配置 */
const router = require('../routers')
const koaBody =  require("koa-body");
const static = require("koa-static");
const render = require('koa-art-template');
const path = require("path");
function initProject(app){
    app.use(koaBody());
    app.use(router.routes());
    app.use(static(path.join(process.cwd(),'static')))
    render(app, {
        root: path.join(process.cwd(), 'pages'),
        extname: '.html',
        debug: process.env.NODE_ENV !== 'production'
    });
}
module.exports = initProject;
